package com.lxb.store.dao;

import com.lxb.store.entity.Goods;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import java.util.List;


public interface GoodsDao extends JpaRepository<Goods,Integer>,JpaSpecificationExecutor<Goods>,PagingAndSortingRepository<Goods,Integer>{

    Goods getById(Integer id);

    @Query("select g from Goods g")
    List<Goods> findTop(Pageable pageable);
}
